<?php
	class Termin{
		private $beschr;
		private $terminID;
		private $vonDatum;
		private $endDatum = false;
		private $bisDatum=null;
		
		function __construct($beschr,$terminID,$vonDatum,$bisDatum){
			$this->beschr=$beschr;
			$this->terminID = $terminID;
			$this->vonDatum=$vonDatum;
			if($bisDatum != null){
				$this->bisDatum=$bisDatum;
				$this->endDatum = true;
			}
		}
		
		
		function mkDate($datum,$uhrzeit){
		}
		
		function getBeschr(){
			return $this->beschr;
		}
		
		function getTerminID(){
			return $this->terminID;
		}
		
		function hasEnde(){
			return $this->endDatum;
		}
		
		function getvonDatum(){
			return $this->vonDatum;
		}
		function getbisDatum(){
			return $this->bisDatum;
		}
		
		function getVonDay(){
			return date("d",$this->vonDatum);
		}
		function getVonMonth(){			
			return date("m",$this->vonDatum);
		}
		function getVonYear(){
			return date("Y",$this->vonDatum);
		}
		function getVonHour(){
			return date("H",$this->vonDatum);
		}
		function getvonMinute(){
			return date("i",$this->vonDatum);
		}
		function getBisDay(){
			if($this->bisDatum == null)
				return "--";
			return date("d",$this->bisDatum);
		}
		function getBisMonth(){		
		if($this->bisDatum == null)
				return "--";	
			return date("m",$this->bisDatum);
		}
		function getBisYear(){
			if($this->bisDatum == null)
				return "--";
			return date("Y",$this->bisDatum);
		}
		function getBisHour(){
			if($this->bisDatum == null)
				return "--";
			return date("H",$this->bisDatum);
		}
		function getBisMinute(){
			if($this->bisDatum == null)
				return "--";
			return date("i",$this->bisDatum);
		}
		
		function printVonDatum(){
			return date("d.m.Y -- H:i",$this->vonDatum);
		}
		
		function printBisDatum(){
			return date("d.m.Y -- H:i",$this->bisDatum);
		}
		
		function __toString(){
			$s="";
			if($this->endDatum){
				$s = "von: ".$this->printVonDatum()."<br>bis: ".$this->printBisDatum();
			}
			else{
				$s="am: ".$this->printVonDatum();
			}
			return $s;
		}
		
		function setBeschr($beschr){
			$this->beschr=$beschr;
		}
		function setVonDatum($vonDatum){
			$this->vonDatum=$vonDatum;
		}
		function setBisDatum($bisDatum){
			if($bisDatum == null){
				$this->bisDatum=null;
				$this->endDatum=false;
			}
			else{	
				$this->bisDatum=$bisDatum;
				$this->endDatum=true;
			}
		}
	}
?>